# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Checks.V1alpha.Model.GoogleChecksReportV1alphaCheck do
  @moduledoc """
  A check that was run on your app.

  ## Attributes

  *   `citations` (*type:* `list(GoogleApi.Checks.V1alpha.Model.GoogleChecksReportV1alphaCheckCitation.t)`, *default:* `nil`) - Regulations and policies that serve as the legal basis for the check.
  *   `evidence` (*type:* `GoogleApi.Checks.V1alpha.Model.GoogleChecksReportV1alphaCheckEvidence.t`, *default:* `nil`) - Evidence that substantiates the check result.
  *   `regionCodes` (*type:* `list(String.t)`, *default:* `nil`) - Regions that are impacted by the check. For more info, see https://google.aip.dev/143#countries-and-regions.
  *   `severity` (*type:* `String.t`, *default:* `nil`) - The urgency or risk level of the check.
  *   `state` (*type:* `String.t`, *default:* `nil`) - The result after running the check.
  *   `stateMetadata` (*type:* `GoogleApi.Checks.V1alpha.Model.GoogleChecksReportV1alphaCheckStateMetadata.t`, *default:* `nil`) - Additional information about the check state in relation to past reports.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of check that was run. A type will only appear once in a report's list of checks.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :citations =>
            list(GoogleApi.Checks.V1alpha.Model.GoogleChecksReportV1alphaCheckCitation.t()) | nil,
          :evidence =>
            GoogleApi.Checks.V1alpha.Model.GoogleChecksReportV1alphaCheckEvidence.t() | nil,
          :regionCodes => list(String.t()) | nil,
          :severity => String.t() | nil,
          :state => String.t() | nil,
          :stateMetadata =>
            GoogleApi.Checks.V1alpha.Model.GoogleChecksReportV1alphaCheckStateMetadata.t() | nil,
          :type => String.t() | nil
        }

  field(:citations,
    as: GoogleApi.Checks.V1alpha.Model.GoogleChecksReportV1alphaCheckCitation,
    type: :list
  )

  field(:evidence, as: GoogleApi.Checks.V1alpha.Model.GoogleChecksReportV1alphaCheckEvidence)
  field(:regionCodes, type: :list)
  field(:severity)
  field(:state)

  field(:stateMetadata,
    as: GoogleApi.Checks.V1alpha.Model.GoogleChecksReportV1alphaCheckStateMetadata
  )

  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.Checks.V1alpha.Model.GoogleChecksReportV1alphaCheck do
  def decode(value, options) do
    GoogleApi.Checks.V1alpha.Model.GoogleChecksReportV1alphaCheck.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Checks.V1alpha.Model.GoogleChecksReportV1alphaCheck do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
